<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>home 地图 </title>
   
        <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAsnD6g25AONVvr5_uQnxNMhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxR2cLQuGnOrK47JDGlIBIlcD_w_jA"></script>

        <script type="text/javascript">
          google.load("maps", "2");

          function initialize() {
            var map = new google.maps.Map2(document.getElementById("map_canvas"));
            var center = new google.maps.LatLng(${user.lat},${user.lng});
            map.setCenter(center, 14);
            map.addControl(new GLargeMapControl());
            var currentMaker = new GMarker(center, {draggable: true});
            map.addOverlay(currentMaker);
            google.maps.Event.addListener(map, "click", function(marker, point) {
                document.getElementById("lat").value = point.y;
                document.getElementById("lng").value = point.x;
                currentMaker.setPoint(point);
            });
            GEvent.addListener(currentMaker, "dragend", function() {
                document.getElementById("lat").value = currentMaker.getPoint().y;
                document.getElementById("lng").value = currentMaker.getPoint().x;
            });
          }
          google.setOnLoadCallback(initialize);
        </script>

  </head>
  <body  onunload="GUnload()">
    <h2>My Status</h2>
    <s:form action="update_mystatus" method="post">
    <s:textfield label="My Status" name="user.status" ></s:textfield>
    <s:textfield label="Lat" name="user.lat" id="lat"></s:textfield>
    <s:textfield label="Lng" name="user.lng" id="lng"></s:textfield>
    <s:submit></s:submit>
    
    </s:form>
    
    
    <div id="map_canvas" style="width: 500px; height: 300px ;border:1px solid red;"></div>
  	
  	

  
  </body>
  
  
</html>

